package com.szrt.java.day20161222.wu.demo06;

public class MathDemo {
	public static void main(String[] args) {
		int c = 89;
		int java = 92;
		int sql = 80;
		
		System.out.println("--------------------------");
		System.out.println("C\t"+"java\t"+"Sql");
		System.out.println(c+"\t"+java+"\t"+sql);
		System.out.println("--------------------------");
		
		int sub = java - sql ;
		System.out.println("Java和Sql的成绩差："+sub);
		
		int sum = c+java+sql;
		
		//整数除以整数结果只能是整数;整数除以小数的结果肯定是小数，就算能够整数，结果后面也会加上.0
		System.out.println(sum/3);
		System.out.println(sum/3.0);
		
		double average = sum /3.0;
		System.out.println("3门课的平均成绩是："+average);
		
		double a = 1.23;
		double b = 3.21 ;
		//面向对象的时候，可以完善的解决double精度丢失的问题
		System.out.println(a+b);
	}
	
}
